package com.action.newbroad;

import com.db.newbroad.*;

public class DeleteOkAction {

	private int no;
	private String pwd;
	private String result;
	private NewbroadDAO newbroad;

	public NewbroadDAO getNewbroad() {
		return newbroad;
	}

	public void setNewbroad(NewbroadDAO newbroad) {
		this.newbroad = newbroad;
	}

	public String getResult() {
		return result;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public int getNo() {
		return no;
	}

	public void setNo(int no) {
		this.no = no;
	}

	public String execute() throws Exception {
		System.out.println("delete :" + no);
		NewbroadVO vo = new NewbroadVO();

		vo = newbroad.newbroadContentData(no);
		if (vo.getPwd().equals(pwd)) {
			result = "OK";
			newbroad.newbroadDelete(no);
		} else {
			result = "NO";
		}

		return "success";
	}

}
